package com.matchmealpha;

import java.util.Date;
import java.util.GregorianCalendar;
import java.util.Scanner;

public class Alert implements Comparable {

	private int alertID;
	private String userID1; //requested friend
	private String userID2; //requester
	private char type;
	private int typeID;
	private GregorianCalendar created;
	
	public Alert(){
		userID1 = "";
		userID2 = "";
	}
	
	public int getAlertID() {
		return alertID;
	}
	
	public void setAlertID(int alertID) {
		this.alertID = alertID;
	}
	public String getUserID1() {
		return userID1;
	}
	public void setUserID1(String userID1) {
		this.userID1 = userID1;
	}
	public String getUserID2() {
		return userID2;
	}
	public void setUserID2(String userID2) {
		this.userID2 = userID2;
	}
	public char getType() {
		return type;
	}
	public void setType(char type) {
		this.type = type;
	}
	public int getTypeID() {
		return typeID;
	}
	public void setTypeID(int typeID) {
		this.typeID = typeID;
	}
	public void setCreated(String time2) {
		Scanner in = new Scanner(time2).useDelimiter("-");
		GregorianCalendar d = new GregorianCalendar(in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt(), in.nextInt()); 
		this.created = d;
	}
	
	public GregorianCalendar getCreated() {
		return created;
	}

	@Override
	public int compareTo(Object another) {
		// TODO Auto-generated method stub
		Alert a = (Alert)another;		
		return created.compareTo(a.getCreated());
	}
}
